﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFP.CollisionDetection;
using SFP;
using SFP.Audio;

namespace HamsterDelivery.LevelStructure.Reactions
{
    public class PackageReaction : Reaction
    {
        private HamsterGame game;

        public PackageReaction(HamsterGame game)
        {
            this.game = game;
        }

        public void pickUpPackage(GameObject gameObj)
        {
            Level level = game.Level;
            level.removeGameObject(gameObj, Level.MAIN_LAYER, level.Packages);
            game.PackageScore++;

            AudioPlayer.play(Resources.A_COIN_SOUND, true);
        }

        protected override void fromBeneath(CollisionInfo collisionInfo)
        {
            pickUpPackage(collisionInfo.GameObject);
        }

        protected override void fromAbove(CollisionInfo collisionInfo)
        {
            pickUpPackage(collisionInfo.GameObject);
        }

        protected override void fromLeft(CollisionInfo collisionInfo)
        {
            pickUpPackage(collisionInfo.GameObject);
        }

        protected override void fromRight(CollisionInfo collisionInfo)
        {
            pickUpPackage(collisionInfo.GameObject);
        }

        protected override void touchesTop(CollisionInfo collisionInfo)
        {
        }

        protected override void touchesBottom(CollisionInfo collisionInfo)
        {
        }

        protected override void touchesLeft(CollisionInfo collisionInfo)
        {
        }

        protected override void touchesRight(CollisionInfo collisionInfo)
        {
        }
    }
}
